package com.tfswue.qmp.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
@Component  //将类交给spring管理

//主要作用是将配置文件中的属性值，封装到对应的实体类中，参数是prefix指的是前缀，父类
@ConfigurationProperties(prefix = "user")

@Data
//@NoArgsConstructor  自动生成无参构造
//@AllArgsConstructor 自动生成全参构造
public class User {
    private Integer id;
    private String username;
    private List<String> address;
    private List<Grade> grades;
}

@Data
class Grade{
    private String subject;
    private Integer score;
}
